home *** CD-ROM | disk | FTP | other *** search
- Path: tribune.usask.ca!usenet
- From: eric@skatter.USask.Ca
- Newsgroups: comp.sys.m68k
- Subject: MC68360 16-bit SPI problems
- Date: 9 Apr 1996 18:15:20 GMT
- Organization: University of Saskatchewan
- Message-ID: <4ke9fo$jvp@tribune.usask.ca>
- NNTP-Posting-Host: pisces.usask.ca
- X-Newsreader: Alexandra.app (Version 0.81)
-
- I'm using the SPI interface to transfer blocks of data between some equipment
- and an MC68EN360. Here's the way I have things set up now:
-
- 1) MOT bit (bit 4) set in SPI transmit and receive function code registers.
- 2) REV bit (bit 10) set in SPI mode register (most significant bit first).
- 3) LEN field in SPI mode register set to 7 (i.e. 8-bit characters).
-
- As an example of how this transfers data, consider the following two bytes in
- memory. I've given each of the bits a letter for easy reference -- bit a is
- the most significant bit of location 0, bit n is the least significant bit of
- location 1.
-
- +---+---+---+---+---+---+---+
- Location 0: | a | b | c | d | e | f | g |
- +---+---+---+---+---+---+---+
- +---+---+---+---+---+---+---+
- Location 1: | h | i | j | k | l | m | n |
- +---+---+---+---+---+---+---+
-
- If these two bytes are transmitted with the above SPI configuration, the bits
- would appear on the wire with bit a first, bit b second and so on:
- FIRST LAST
- a b c d e f g h i j k l m n
-
- This method of transferring data may place too high a load on the
- communication controller inside the 68360. I decided to reduce the load byt
- doing the transfers 16-bits at a time. I changed the LEN field in the SPI
- mode register from 7 to 15.
-
- Now, the bits are transmitted in the following order:
- FIRST LAST
- h i j k l m n a b c d e f g
-
- It seems that the Least Significant Byte of the 16-bit word is being
- transferred first. I had expected that the bits would appear on the wire
- just as they had in the 8-bit case!
-
- Am I going to have to byte-swap all my data before sending it to, and after
- receiving it from, the SPI interface? (!!!) Or is there some configuration
- detail that I've missed?
-
- Is the above behaviour the same in all revisions of the 68360?
-
- --
- Eric Norum eric@skatter.usask.ca
- Saskatchewan Accelerator Laboratory Phone: (306) 966-6308
- University of Saskatchewan FAX: (306) 966-6058
- Saskatoon, Canada. NeXTMail accepted.
-